<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<div class="portlet box blue">
	<div class="portlet-title">
		<div class="caption">
			<i class="fa fa-gift"></i>订单编辑
		</div>
	</div>
	<div class="portlet-body form">
		<form id="ordertForm" class="form-horizontal form-bordered"
			action="/ordert/saveUpdate" method="post">

			<div class="ebayform-top">
				<span>销售渠道</span><select style="width: 80%; margin-left: 20px;"
					name="salechannel">

					<option value="${ordertDetail.platform.id}" selected>${ordertDetail.platform.name}</option>
					<c:forEach items="${plist}" var="p" varStatus="vs">
						<option value="${p.id}">${p.name}</option>
					</c:forEach>
				</select><br> <br> <span>账户名称</span><input type="text"
					value="${ordertDetail.person.uid}"
					style="width: 80%; margin-left: 20px;" name="accountname" /><br>
				<br> <span>订单号</span><input type="text"
					value="${ordertDetail.code}" style="width: 80%; margin-left: 33px;"
					name="orderid" />

			</div>

			<div class="ebayform-second">
				<label>订单概要</label><br> <br> <span>付款形式:</span><input
					type="checkbox" style="margin-left: 20px;" name="checkpend" />该订单已付款<br>
				<br> <span>支付形式:</span><input type="text"
					style="width: 30%; margin-left: 20px;" name="paymethod" /><span
					style="margin-left: 50px;">支付日期:</span><input type="text"
					value="${ordertDetail.createtime}" name="paydate"
					style="width: 30%; margin-left: 20px;" /><br> <br> <span>总支付:</span><input
					type="text" style="width: 30%; margin-left: 33px;" name="totalpay"
					value="${ordertDetail.price}" />
			</div>

			<div class="ebayform-second">
				<label>收货人信息</label><br> <br> <span>收货人:</span><input
					style="width: 80%; margin-left: 33px;" name="receivername"
					value="${ordertDetail.person.name}" /><br> <br> <span>地址:</span><input
					style="width: 80%; margin-left: 46px;" name="address"
					value="${ordertDetail.person.address}" /><br> <br> <span>手机号:</span><input
					type="text" value="${ordertDetail.person.phone}"
					style="width: 30%; margin-left: 33px;" name="phone" /><span
					style="margin-left: 50px;">邮编:</span><input type="text"
					value="${ordertDetail.person.zipcode}"
					style="width: 30%; margin-left: 20px;" name="postalcode" />
			</div>

			<div class="ebayform-second">
				<label>发货信息</label><br> <br> <span>发货仓库:</span> <select
					style="width: 80%; margin-left: 16px;" name="warsehose">

					<option value="${ordertDetail.warehouse.id}" selected>${ordertDetail.warehouse.name}</option>
					<c:forEach items="${warehouses}" var="w" varStatus="vs">
						<option value="${w.id}">${w.name}</option>
					</c:forEach>
				</select> <br> <br> <span>邮寄方式:</span> <select id="logisticsId"
					style="width: 80%; margin-left: 16px;" name="shiptype">
					<option value="${deliverGoods.logistics.id}">${deliverGoods.logistics.name}</option>
					<c:forEach items="${loglist}" var="log" varStatus="vs">
						<option value="${log.id}">${log.name}</option>
					</c:forEach>
				</select> <br> <br> <span>运单号:</span><input
					value="${deliverGoods.logisticsCode}"
					style="width: 80%; margin-left: 33px;" name="shipnumid" />
			</div>


			<div class="ebayform-second">
				<label>备注</label><br> <br>
				<textarea class="form-control" rows="3" name="note">${ordertDetail.description}</textarea>
			</div>

			<div class="ebayform-second">
				<label>商品信息</label><label style="margin-left: 50px;">请选择商品</label><br>
				<br>
				<table class="table table-striped table-hover table-info"
					style="width: 95%;">
					<thead>
						<tr>
							<th>商品名称</th>
							<th>商品SKU</th>
							<th>单价</th>
							<th>数量</th>
							<th>当前库存</th>
							<th>发货SKU</th>
							<th>总价</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${orderItems}" var="items" varStatus="vs">
							<tr>
								<td><input type="text" value="${items.product.name}"
									name="productname1" /></td>
								<td><input type="text" value="${items.product.code}"
									name="sku1" /></td>
								<td><input type="text" value="${items.price}" name="price1"></td>
								<td><input type="text" value="${items.count}"
									name="amount1" /></td>
								<td><input type="text"
									value="${items.product.stock.stockNum}" name="currentstock1" /></td>
								<td><input type="text" value="${items.sku}" name="shipsku1" /></td>
								<td><input type="text" value="${items.totalPrice}"
									name="totalprice1" /></td>
							</tr>
						</c:forEach>

					</tbody>
				</table>
			</div>



			<div class="form-actions">
				<div class="col-md-9 col-md-offset-3">
					<button type="button" class="btn btn-primary"
						onclick="newHandOrdersss(this)">
						<spring:message code="btn.save"></spring:message>
					</button>



					<button type="reset" class="btn btn-default" onclick="cancel()">
						<spring:message code="btn.return"></spring:message>
					</button>
				</div>
			</div>
			<input type="hidden" name="id" value="${ordertDetail.id}">
			<input type="hidden" name="orderStatusId" value="${ordertDetail.orderStatus.id}">
			
		</form>
	</div>
</div>

<style type="text/css">
.ebayform-top, .ebayform-second {
	padding: 2%;
	border: 1px solid #C1C1C1;
}

.ebayform-second label {
	font-size: 16px;
	font-weight: bold;
}
</style>
<script type="text/javascript"
	src="<c:url value="/static/custom/datepicker-util.js"></c:url>"></script>

